<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>component-1</title>
    <script type="text/javascript" src="../assets/js/vue-2.3.0.js"></script>    
</head>
<body>
    <h1>组件-1</h1>
    <hr>
    <div id="app">
        <melo></melo> 
        <tcm></tcm>
    </div>
</body>
<script type="text/javascript">
    //全局注册
    Vue.component('melo', {
        template:'<div style="color:orange;">全局注册组件</div>'
    })
    Vue.component('tcm', {
        template:'<div style="color:red;">淘菜猫</div>'
    })

    var app = new Vue({
        el:"#app",
        data:{
            code:'hello'
        },
        components:{
            "anthony":{
                template:`<div style="color:blue;">局部注册组件</div>`,
            }
        }
    })

</script>
</html>